package com.baiyun.stock.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Builder
@HeadRowHeight(value = 20) // 表头行高
@ContentRowHeight(value = 15) // 内容行高
@ColumnWidth(value = 30) // 列宽
public class User implements Serializable {
    //索引位从0开始
    @ExcelProperty(value = {"用户基本信息","用户名"},index = 0)
    private String userName;
    @ExcelProperty(value = {"用户基本信息","年龄"},index = 1)
    private Integer age;
    @ExcelProperty(value = {"用户基本信息","地址"},index = 2)
    private String address;

    @ExcelProperty(value = {"用户基本信息","生日"},index = 3)
    @DateTimeFormat("yyyy年MM月dd日")
    @ExcelIgnore
    private Date birthday;
}
